package com.link2room.jetfire.enums;

import org.apache.commons.lang.StringUtils;

/*
 * 订单来源，WEB官网，WECHAT微信,APP应用程序，TMALL天猫
 */
public enum ReservationPbChannelEnum {

	WEB("WEB", "官网"),WECHAT("WECHAT", "微信"),APP("APP", "应用程序"),TMALL("TMALL", "天猫"),;
	
	private String code;
	private String des;

	private ReservationPbChannelEnum(String code, String des) {
		this.code = code;
		this.des = des;
	}
	
	public static String getDesByCode(String code) {
		if(StringUtils.isBlank(code) ) {
			return null;
		}
		for(ReservationPbChannelEnum reservationPbChannelEnum : ReservationPbChannelEnum.values()) {
			if(StringUtils.equals(code, reservationPbChannelEnum.getCode())) {
				return reservationPbChannelEnum.getDes();
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

}
